package edu.pdx.cs.cs542s07.minichess;

import java.util.ArrayList;

/**
 * Tests our move simulation system -- simulating a move shouldn't affect the original.
 * @author Michael C. Smith <maxomai at gmail dot com>
 *
 */
public class MoveSimulationTest {

	/**
	 * @param args
	 */
//	public static void main(String[] args) {
//		Board board = new Board();
//		MoveFactory fac = new MoveFactory();
//		try {
//			Board board2 = board.simulatesMove(new Move(new Square(1,2), new Square(2,2)));
//			board2.move(new Move(new Square(4,2), new Square(3,2)));
//			System.out.println(board2);
//			ArrayList<Move> moves = fac.generateMoves(board2);
//			MoveFactoryTest.printMoves(moves);
//			System.out.println(board);
//			moves = fac.generateMoves(board);
//			MoveFactoryTest.printMoves(moves);
//		} catch (IllegalMoveException e) {
//			e.printStackTrace();
//		}
//		
//	}
	
	public static void main(String[] args) {
	Board board = new Board();
	MoveFactory fac = new MoveFactory();
	try {
		board.move(new Move(new Square(1,2), new Square(2,2)));
		board.move(new Move(new Square(4,2), new Square(3,2)));
		board.move(new Move(new Square(1,3), new Square(2,3)));
		board.move(new Move(new Square(3,2), new Square(2,3)));
		System.out.println(board);
		ArrayList<Move> moves = fac.generateScoredMoves(board);
		MoveFactoryTest.printMoves(moves);
		board.undo();
		System.out.println(board);
		moves = fac.generateScoredMoves(board);
		MoveFactoryTest.printMoves(moves);
		board.undo();
		System.out.println(board);
		moves = fac.generateScoredMoves(board);
		MoveFactoryTest.printMoves(moves);
		board.undo();
		System.out.println(board);
		moves = fac.generateScoredMoves(board);
		MoveFactoryTest.printMoves(moves);
		board.undo();
		System.out.println(board);
		moves = fac.generateScoredMoves(board);
		MoveFactoryTest.printMoves(moves);
	} catch (IllegalMoveException e) {
		e.printStackTrace();
	}
	
}

}
